﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace BookManagermentSystem
{
    public partial class MainMenuForm : Form
    {
        public MainMenuForm()
        {
            InitializeComponent();
        }

        private static MainMenuForm menuForm = null;

        public static MainMenuForm getInstance()
        {
            if (menuForm == null)
            {
                menuForm = new MainMenuForm();
            }

            return menuForm;
        }

        private void btnCategory_Click(object sender, EventArgs e)
        {
            this.Hide();
            new ReaderCategoryForm().Show();
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void btnBook_Click(object sender, EventArgs e)
        {
            this.Hide();
            new BookManagermentForm().Show();
        }

        private void btnReader_Click(object sender, EventArgs e)
        {
            this.Hide();
            new ReaderManagermentForm().Show();
        }

        private void btnBorrRet_Click(object sender, EventArgs e)
        {
            this.Hide();
            new BorrAndRetForm().Show();
        }

        private void MainMenuForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            menuForm = null;
            Application.Exit();
        }
    }
}
